﻿Imports FairShop
Imports System
Imports System.Text
Imports System.Collections.Generic
Imports Microsoft.VisualStudio.TestTools.UnitTesting

<TestClass()> _
Public Class TestSamengesteldeArtikelsDal

    Private testContextInstance As TestContext

    '''<summary>
    '''Gets or sets the test context which provides
    '''information about and functionality for the current test run.
    '''</summary>
    Public Property TestContext() As TestContext
        Get
            Return testContextInstance
        End Get
        Set(ByVal value As TestContext)
            testContextInstance = value
        End Set
    End Property

#Region "Additional test attributes"
    '
    ' You can use the following additional attributes as you write your tests:
    '
    ' Use ClassInitialize to run code before running the first test in the class
    <ClassInitialize()> _
    Public Shared Sub MyClassInitialize(ByVal testContext As TestContext)
        AppDomain.CurrentDomain.SetData("APPBASE", Environment.CurrentDirectory)
    End Sub
    '
    ' Use ClassCleanup to run code after all tests in a class have run
    ' <ClassCleanup()> Public Shared Sub MyClassCleanup()
    ' End Sub
    '
    ' Use TestInitialize to run code before running each test
    ' <TestInitialize()> Public Sub MyTestInitialize()
    ' End Sub
    '
    ' Use TestCleanup to run code after each test has run
    ' <TestCleanup()> Public Sub MyTestCleanup()
    ' End Sub
    '
#End Region

    <TestMethod()> _
    Public Sub GetHoofdartikelIdsTest()
        Dim list As List(Of Integer) = SamengesteldeArtikelsDal.GetHoofdartikelIds()
        Assert.IsTrue(list.Count > 0)
    End Sub

    <TestMethod()> _
    Public Sub GetHoofdartikelsTest()
        Dim ds As New ArtikelLijstDataSet()
        SamengesteldeArtikelsDal.FillHoofdartikels(ds)
        Assert.IsTrue(ds.Artikels.Rows.Count > 0)
    End Sub

    <TestMethod()> _
    Public Sub GetDeelartikelsTest()
        Dim ds As New ArtikelLijstDataSet()
        SamengesteldeArtikelsDal.FillDeelartikels(42800, ds)
        Assert.IsTrue(ds.Artikels.Rows.Count > 0)
    End Sub

End Class
